package com.github.llyb120.qiuya.type;

public class QString implements CharSequence {
    private String str;

    @Override
    public int length() {
        return str.length();
    }

    @Override
    public char charAt(int index) {
        return str.charAt(index);
    }

    @Override
    public CharSequence subSequence(int start, int end) {
        return str.subSequence(start, end);
    }

    /**
     * 类型长度+自身实际长度
     * @param maxLen
     * @return
     */
    public static int len(int maxLen){
        return Short.BYTES + Integer.BYTES + maxLen;
    }

    public boolean error(){
        return true;
    }
}

